import Vue from 'vue'
import vueRouter from 'vue-router'

import home from 'views/home'
import detail from 'views/detail'
import list from 'views/list'


import index from 'views/home/index'
import kinds from 'views/home/kinds'
import vip from 'views/home/vip'
import shoplist from 'views/home/shoplist'
import mine from 'views/home/mine'
import page404 from 'views/home/page404'

import index_recommend from 'views/home/index/index_recommend'
import index_foods from 'views/home/index/index_foods'
import index_makeup from 'views/home/index/index_makeup'
import index_appliances from 'views/home/index/index_appliances'

Vue.use(vueRouter)

let router = new vueRouter({
  routes: [
    {
      path: '/',
      redirect: '/home/index'
    },
    {
      path: '/home',
      redirect: '/home/index',
      component: home,
      children: [
        {
          path: '/home/index',
          component: index,
          children: [
            {
              path: '/',
              redirect: 'index_recommend'
            },
            {
              path:'index_recommend',
              component:index_recommend,
              meta:{
                path:'index',
              }
            },
            {
            path:'index_makeup',
            component:index_makeup,
            meta:{
              path:'index',
            }
            },
            {
            path:'index_appliances',
            component:index_appliances,
            meta:{
              path:'index',
            }
            },
            {
            path:'index_foods',
            component:index_foods,
            meta:{
              path:'index',
            }
            },
          ]
        },
        {
          path:'/home/kinds',
          component:kinds,
          meta:{
            path:'kinds',
          }
        },
        {
          path:'/home/vip',
          component:vip,
          meta:{
            path:'vip',
          }
        },
        {
          path:'/home/shoplist',
          meta:{
            path:'shoplist',
          },
          component:shoplist
        },
        {
          path:'/home/mine',
          meta:{
            path:'mine',
          },
          component:mine
        }
      ]
    },
    {
      path: '/detail',
      component: detail,
    },
    {
      path: '/list',
      component: list,
    },
    {
      path: '*',
      component: page404
    }
  ],
  mode: 'hash'
})

export default router